<!DOCTYPE html>
<html>
<#include "head.html">
<head>
</head>
    <body>
    <table class="mc">
        <tr>
            <td class="mc-l">
                <!--左侧导航---{-->
                <div id="navPanelContainer">
                    <div class="system-logo cd"></div>
                    <!--管理员信息---{-->
                    <#include "adminInfo.html">
                </div>
                <!--左侧导航---}-->
            </td>
            <td class="mc-m">
                <div class="navToggle"></div>
            </td>
            <td class="mc-r">
                <!--顶部导航---{-->
                <#include "topNav.html">
                    <!--顶部导航---}-->
                            <!--工具栏--{-->
                            <div id="toolbar" class="clearfix">
                                <div class="toolbor-module search">
                                    <input type="button" class="input-button return" value="返回" onclick="history.go(-1)">
                                </div>
                            </div>
                            <!--工具栏--}-->

                            <div id="main" class="clearfix">
                                <form action="${request.getContextPath()}/admin/modifyPwd.html" 
                                method="post" name="form_user" onsubmit="return checkpwd();">
                                    <div class="valBox w750">
                                        <div class="top">
                                            <strong>修改用户密码</strong>
                                        </div>
                                        <div class="val clearfix">
                                            <ul class="editUserInfoX">
                                            	<li>
                                                    <div class="title">用户名：</div>
                                                    <div class="v">
                                                       ${username?if_exists}
                                                    </div>
                                                </li>
                                                <li>
                                                    <div class="title">原密码：</div>
                                                    <div class="v">
                                                        <input type="password" class="input_border" name="password" id="password" value="" >
                                                    </div>
                                                </li>
                                                <li>
                                                    <div class="title">新密码：</div>
                                                    <div class="v">
                                                        <input type="password" class="input_border" name="firstpwd" id="firstpwd" onblur="check1()">
                                                        <b class="passwordb"></b>
                                                    </div>
                                                </li>
                                                <li>
                                                    <div class="title">确认密码：</div>
                                                    <div class="v">
                                                        <input type="password" class="input_border" name="secondpwd" id="secondpwd" onblur="check2()">
                                                        <b class="secondpwdb"></b>
                                                    </div>
                                                </li>
                                            </ul>
                                            <div class="other">
                                                <input type="hidden" name="actionType" value="adminmodifypassword" />
                                                <input type="hidden" name="username" value="${username}" />
												<input type="hidden" name="user_id" value="${user_id?c}" />
                                                <input type="submit" value="提交" class="input-button post">
                                            </div>
                                        </div>
                                    </div>

                                </form>

                            </div>
            </td>
        </tr>
        <tr>
            <!--尾部--{-->
            <td colspan="3" class="mc-b"><#include "foot.html"></td>
            <!--尾部--}-->
        </tr>
    </table>
    <script src="${request.getContextPath()}/themes/admin/js/area.js"></script>
    <script type="text/javascript">
		function check1(){
		  	//判断密码
		  	var pass_reg = /^(?![0-9A-Za-z]+$)[0-9A-Za-z~!@#$%^&*()]{10,}$/ ;
		  	var number_reg = /[0-9]+/;
		  	var firstpwdb = $(".passwordb");
		  	var password = $('#password').val();
		  	var firstpwd = $('#firstpwd').val();
		  	
		  	if(!pass_reg.exec(firstpwd)){
		  		firstpwdb.html('密码长度至少为10位，请使用数字字母特殊字符(~!@#$%^&*())的组合');
		  		return false;
		  	}else if(password == firstpwd){
		  		firstpwdb.html('原密码和新密码不能相同');
		  		return false;
		  	}else if(!number_reg.test(firstpwd)){
		  		firstpwdb.html('密码长度至少为10位，请使用数字字母特殊字符(~!@#$%^&*())的组合');
	    		return false;
		  	}else{
		  		firstpwdb.html('');
		  		return true;
		  	}
	  	}
	  	function check2(){
			var secondpwdb = $(".secondpwdb");
			var pass1 = $('#firstpwd').val(); 
			var pass2 = $('#secondpwd').val(); 
			if(pass1 == pass2){
			 	secondpwdb.html('');
			 	return true;
			}else{
			 	secondpwdb.html('两次密码输入不一致');
			    return false; 
			}
	  	}
	  
	  	function checkpwd(){
			check1();
			check2();
			if(check1() &&  check2()){
				return true;
			}else{
				return false;
			}	
		}
    </script>
    </body>
</html>
<#include "jsPage.html">